// async异步处理，封装之后要配合promise处理
function ajax(url){
    return new Promise(function(resolve,reject){
      $.getJSON(url,function(result){
        resolve(result)
       },function(error){
        reject(error) 
       })
     })
  }
  
  
  async function getInfo(){
    let ids = await ajax("http://iwenwiki.com/api/generator/list.php")
    let names = await ajax("http://iwenwiki.com/api/generator/id.php?id="+ids[0])
    let infos = await ajax("http://iwenwiki.com/api/generator/name.php?name=" + names.name)
    console.log(infos);
  }
  
  
  getInfo();
  